package com.suse.common.config.response;

public enum SimpleCode implements Code {

    // 服务器异常
    SERVER_ERROR(500,"服务器异常！"),

    // 请求异常
    PARAM_ERROR(400,"请求参数异常！"),
    BODY_PARAM_ERROR(400,"请求体参数异常！"),
    METHOD_NOT_ALLOW(400,"请求方法不被允许！"),

    // 未登录
    NO_LOGIN(403,"未登录或登录已过期，请重新登录！"),

    // 拒绝访问
    ACCESS_DENIED(403,"您的权限不够，无法访问，请联系管理员！"),

    // 操作异常
    LOGIN_ERROR(500,"登录异常!"),
    LOGOUT_ERROR(500,"注销异常!"),
    SAVE_ERROR(500,"添加异常！"),
    REMOVE_ERROR(500,"删除异常！"),
    UPDATE_ERROR(500,"修改异常！"),

    // 操作成功
    LOGIN_SUCCESS(200,"登录成功"),
    LOGOUT_SUCCESS(200,"注销成功"),
    SAVE_SUCCESS(200,"添加成功"),
    REMOVE_SUCCESS(200,"删除成功"),
    UPDATE_SUCCESS(200,"修改成功"),
    ;

    private final Integer code;

    private String message;

    SimpleCode(Integer code) {
        this.code = code;
    }

    SimpleCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
